package com.jie.canal;

import com.jie.canal.client.CanalClient;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.Resource;

/**
 * 监听远程数据库(这里是我虚拟机上的mysql), 当发生变化, 则对本机数据库上的数据做改变(通过canal实现)
 * @author XieZhiJie
 * @create 2020-10-18 16:53
 */
@SpringBootApplication
public class CanalApplication implements CommandLineRunner {

    @Resource
    private CanalClient canalClient;

    public static void main(String[] args) {
        SpringApplication.run(CanalApplication.class, args);
    }

    @Override
    public void run(String... strings) throws Exception {
        // 项目启动，执行canal客户端监听
        canalClient.run();
    }

}
